package cn.elvea.service;

import cn.elvea.domain.Role;
import cn.elvea.domain.User;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class UserService {
    public User findByUsername(String username) {
        Role role = new Role();
        role.setId(1l);
        role.setCode("admin");

        User user = new User();
        user.setId(1l);
        user.setUsername("admin");
        user.setPassword("admin");
        user.setRole(role);
        return user;
    }
}
